package org.linlinjava.litemall.db.domain;

   import java.io.*;

   public class SerializationTest {
       public static void main(String[] args) {
           LitemallAdmin admin = new LitemallAdmin();
           // 设置一些字段值
           
           try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("admin.ser"))) {
               oos.writeObject(admin);
           } catch (IOException e) {
               e.printStackTrace();
           }

           try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream("admin.ser"))) {
               LitemallAdmin deserializedAdmin = (LitemallAdmin) ois.readObject();
               System.out.println(deserializedAdmin);
           } catch (IOException | ClassNotFoundException e) {
               e.printStackTrace();
           }
       }
   }
   